package Principal;

import de.centigrade.bizlaf.BizLafControl;
import de.centigrade.bizlaf.support.BizLafStyles;
import java.sql.ResultSet;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import javax.swing.ImageIcon;
import javax.swing.table.DefaultTableModel;
import java.io.IOException;
import java.net.InetAddress;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

/**
 * Panel principal donde muestra la barra de herramientas del sistema. Con las
 * opciones:
 * <ul>
 * <li> Herramientas </li>
 * <li> Ventas </li>
 * <li> Clientes </li>
 * </ul>
 *
 * @author Pascual Guerrero
 * @author Enrique Perera
 * @version %I%, %G%
 * @since Principal 1.0.0
 */
public class VentanaPrincipal extends javax.swing.JFrame {

    InetAddress ip;
    StringBuilder sb;
    public static String giro ="";
    public static boolean local = false;//esto dice si trabajamos o no con el cache
    public static PreparedStatement ps;
    public static ResultSet rs;
    public static DefaultTableModel dtm;
    public static PrecioCantidad prcd;
    public static descuento desc;
    public static otroProducto otto;
    public static pasarDato dato;
    public static String nusuario="";
    public static int idNivel = 0;
    public static int idUsuario = 0;// es el usuario nulo
    public static int sesionId;
    public static int caja = 0;
    public static DecimalFormat nf;
    public static Number number = null;
    public static Number number2 = null;
    public static NumberFormat fmt = NumberFormat.getInstance();
    public static int sucursal = 1;
    public static boolean imprimir = false;
    public static boolean mostrarAlmacen = false;
    Properties propiedades;
    public static boolean sincronizando=false;
    public static final Logger logger = Logger.getLogger(PanelVentas.class.getName());//log de errores
    jcProperties editarPropiedades;
    static java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    /**
     * Constructor de la clase teslas
     *
     * @return
     */
    public VentanaPrincipal() {
        initComponents();
        BizLafControl.get().setStyle(jPanel2, BizLafStyles.FOOTER_BAR);
        BizLafControl.get().setStyle(vendedor, BizLafStyles.SHADOWED);
        BizLafControl.get().setStyle(baseDatos, BizLafStyles.SHADOWED);
        cargarPropiedades();
        cargarLog();
        new Ticket();
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        vendedor = new javax.swing.JLabel();
        actualizacion = new javax.swing.JProgressBar();
        baseDatos = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem22 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        cerrarSesion = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        JMventas = new javax.swing.JMenu();
        JMcliente = new javax.swing.JMenu();
        JMagregarNuevo = new javax.swing.JMenuItem();
        JMverTodos = new javax.swing.JMenuItem();
        Actualizar = new javax.swing.JMenu();
        Cambio = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("TeslaBEM Punto De Venta (Version Beta)");
        setIconImage(new ImageIcon(getClass().getResource("/Imagenes/logo_rayito.png")).getImage());
        setMinimumSize(new java.awt.Dimension(400, 300));
        addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                formKeyPressed(evt);
            }
        });

        vendedor.setText("Vendedor:");

        baseDatos.setText("Actualizacion de la base de datos:");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(vendedor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(baseDatos)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(actualizacion, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(baseDatos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(vendedor))
                    .addComponent(actualizacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        jTabbedPane1.setMinimumSize(new java.awt.Dimension(400, 279));
        jTabbedPane1.setPreferredSize(new java.awt.Dimension(800, 579));
        jTabbedPane1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTabbedPane1MouseClicked(evt);
            }
        });

        fileMenu.setMnemonic('f');
        fileMenu.setText("Herramientas");

        jMenuItem2.setText("Configuracion del Servidor");
        jMenuItem2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenuItem2MouseClicked(evt);
            }
        });
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        fileMenu.add(jMenuItem2);

        jMenuItem3.setText("Configuracion de la impresora de Tickets");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        fileMenu.add(jMenuItem3);

        jMenuItem4.setText("Folios de documentos");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        fileMenu.add(jMenuItem4);

        jMenuItem22.setText("Cambiar Usuario");
        jMenuItem22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem22ActionPerformed(evt);
            }
        });
        fileMenu.add(jMenuItem22);

        jMenuItem5.setText("Monedero");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        fileMenu.add(jMenuItem5);

        cerrarSesion.setText("Cerrar Sesion");
        cerrarSesion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cerrarSesionActionPerformed(evt);
            }
        });
        fileMenu.add(cerrarSesion);

        jMenu1.setText("Reajustar Productos");
        jMenu1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenu1MouseClicked(evt);
            }
        });
        fileMenu.add(jMenu1);

        jMenuItem1.setText("Cambiar Sucursal/Caja");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        fileMenu.add(jMenuItem1);

        menuBar.add(fileMenu);

        JMventas.setText("Ventas");
        JMventas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                JMventasMouseClicked(evt);
            }
        });
        menuBar.add(JMventas);

        JMcliente.setText("Clientes");

        JMagregarNuevo.setText("Agregar Nuevo");
        JMagregarNuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JMagregarNuevoActionPerformed(evt);
            }
        });
        JMcliente.add(JMagregarNuevo);

        JMverTodos.setText("Ver Todos");
        JMverTodos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JMverTodosActionPerformed(evt);
            }
        });
        JMcliente.add(JMverTodos);

        menuBar.add(JMcliente);

        Actualizar.setText("Actualizar");
        Actualizar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                ActualizarMouseClicked(evt);
            }
        });
        menuBar.add(Actualizar);

        Cambio.setText("Cambio");
        Cambio.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                CambioMouseClicked(evt);
            }
        });
        menuBar.add(Cambio);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 780, Short.MAX_VALUE)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
                .addGap(2, 2, 2)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
public static void sincronizar(boolean sinc){
    VentanaPrincipal.sincronizando=sinc;
        VentanaPrincipal.JMcliente.setEnabled(!sinc);
        VentanaPrincipal.JMventas.setEnabled(!sinc);
        VentanaPrincipal.Actualizar.setEnabled(!sinc);
        VentanaPrincipal.fileMenu.setEnabled(!sinc);
        VentanaPrincipal.Cambio.setEnabled(!sinc);
}
    private void cargarPropiedades() {
        editarPropiedades = new jcProperties();
        propiedades = new Properties();
        try {
            propiedades = editarPropiedades.getProperties();
            imprimir = propiedades.getProperty("Imprimir").equals("Si");
            giro = propiedades.getProperty("giro");
            mostrarAlmacen=propiedades.getProperty("MostrarAlmacen").equals("1");
            Ticket.size = Integer.parseInt(propiedades.getProperty("Size"));
        } catch (Exception e) {
            logger.log(Level.SEVERE, null, e);

        }

    }

    public void setUsuario(int user, int nivel, int sesion, int cj, int suc, String nombreSucursal) {
        idUsuario = user;
        idNivel = nivel;
        sesionId = sesion;
        caja = cj;
        sucursal = suc;
        vendedor.setText("Vendedor: "+nusuario);
        super.setTitle("TeslaBEM Caja " + caja + " " + nombreSucursal);
        // Empezamos con todos los accessos deshabilitados
      /*  JBvender.setEnabled(false);
         JBverdetalle.setEnabled(false);
         JBvenderOtro.setEnabled(false);
         JBbazar.setEnabled(false);
         JBgastos.setEnabled(false);
         JBdescuento.setEnabled(false);
         JBeditar.setEnabled(false);
         JBeliminar.setEnabled(false);
         JBverDetallesVenta.setEnabled(false);
         JBcancelarVenta.setEnabled(false);
         JBfinalizarVenta.setEnabled(false);
         JMventas.setEnabled(false);
         JMverTodos.setEnabled(false);

         switch (nivel) {
         case 1:
         JBvender.setEnabled(true);
         JBverdetalle.setEnabled(true);
         JBvenderOtro.setEnabled(true);
         JBbazar.setEnabled(true);
         JBeditar.setEnabled(true);
         JBeliminar.setEnabled(true);
         JBverDetallesVenta.setEnabled(true);
         JBcancelarVenta.setEnabled(true);
         JBfinalizarVenta.setEnabled(true);
         JMventas.setEnabled(true);
         break;

         case 2:
         JBverdetalle.setEnabled(true);
         JMventas.setEnabled(true);
         JMverTodos.setEnabled(true);
         break;

         case 3:
         JBvender.setEnabled(true);
         JBverdetalle.setEnabled(true);
         JBvenderOtro.setEnabled(true);
         JBbazar.setEnabled(true);
         JBdescuento.setEnabled(true);
         JBeditar.setEnabled(true);
         JBeliminar.setEnabled(true);
         JBverDetallesVenta.setEnabled(true);
         JBcancelarVenta.setEnabled(true);
         JBfinalizarVenta.setEnabled(true);
         JMventas.setEnabled(true);
         JMverTodos.setEnabled(true);
         break;

         case 5:
         JBvender.setEnabled(true);
         JBverdetalle.setEnabled(true);
         JBvenderOtro.setEnabled(true);
         JBbazar.setEnabled(true);
         JBdescuento.setEnabled(true);
         JBeditar.setEnabled(true);
         JBeliminar.setEnabled(true);
         JBverDetallesVenta.setEnabled(true);
         JBcancelarVenta.setEnabled(true);
         JBfinalizarVenta.setEnabled(true);
         break;

         case 6:
         JBverdetalle.setEnabled(true);
         JBgastos.setEnabled(true);
         JBfinalizarVenta.setEnabled(true);
         break;

         case 7:
         JBvender.setEnabled(true);
         JBverdetalle.setEnabled(true);
         JBvenderOtro.setEnabled(true);
         JBbazar.setEnabled(true);
         JBgastos.setEnabled(true);
         JBdescuento.setEnabled(true);
         JBeditar.setEnabled(true);
         JBeliminar.setEnabled(true);
         JBverDetallesVenta.setEnabled(true);
         JBcancelarVenta.setEnabled(true);
         JBfinalizarVenta.setEnabled(true);
         JMventas.setEnabled(true);
         JMverTodos.setEnabled(true);
         break;

         case 8:
         case 9:
         break;

         case 4:
         case 10:
         JBverdetalle.setEnabled(true);
         cerrarSesion.setEnabled(false);
         break;

         default:
         JOptionPane.showMessageDialog(this, "No tiene asignado permisos de acceso\n", "Atencion", JOptionPane.INFORMATION_MESSAGE);
         break;
         }*/
    }

    private void formKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_formKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_formKeyPressed

    private void jTabbedPane1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane1MouseClicked
        if (evt.getClickCount() > 1) {

            jTabbedPane1.add("Venta " + (jTabbedPane1.getTabCount() + 1), new PanelVentas());
            jTabbedPane1.setTabComponentAt(jTabbedPane1.getTabCount() - 1, new ButtonTabComponent(jTabbedPane1));

        }

        // TODO add your handling code here:
    }//GEN-LAST:event_jTabbedPane1MouseClicked

    private void JMverTodosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JMverTodosActionPerformed
        verPersonas listarpersonas = new verPersonas();
        listarpersonas.setVisible(true);
        // TODO add your handling code here:
    }//GEN-LAST:event_JMverTodosActionPerformed

    private void JMagregarNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JMagregarNuevoActionPerformed
        nPersona persona = new nPersona(this, true, 0);
        persona.setVisible(true);
        // TODO add your handling code here:
    }//GEN-LAST:event_JMagregarNuevoActionPerformed

    private void JMventasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JMventasMouseClicked
//        if (JMventas.isEnabled()) {
            detalleVentas = new ventas();
            detalleVentas.setVisible(true);
       // }
        // TODO add your handling code here:
    }//GEN-LAST:event_JMventasMouseClicked

    private void jMenuItem22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem22ActionPerformed
        cambiarUser = new Usuario();
        cambiarUser.setOtro(true);
        cambiarUser.setDefaultCloseOperation(HIDE_ON_CLOSE);
        cambiarUser.setVisible(true);
        this.dispose();
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem22ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        misFolios = new cambiarFolios(this, true);
        misFolios.setVisible(true);
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        nuevaImpresora = new configurarImpresora(this, true);
        nuevaImpresora.setVisible(true);

        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed

        miconexion = new cambiarConexion(this, true);

        miconexion.setVisible(true);

    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuItem2MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem2MouseClicked

    private void cerrarSesionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cerrarSesionActionPerformed
        (new CerrarSesion(this, true, idUsuario, sesionId, this)).setVisible(true);
    }//GEN-LAST:event_cerrarSesionActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        new Monedero().setVisible(true);



    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void ActualizarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ActualizarMouseClicked
//        (new ActualizarRegistros()).setVisible(true);
Thread dato = new Thread(new actualizarThread());
                        dato.start();
        // TODO add your handling code here:
    }//GEN-LAST:event_ActualizarMouseClicked

    private void CambioMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CambioMouseClicked
        (new gastados()).setVisible(true);
        // TODO add your handling code here:
    }//GEN-LAST:event_CambioMouseClicked

    private void jMenu1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenu1MouseClicked
        if(!local)
        (new Reajustar()).setVisible(true);
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenu1MouseClicked

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        (new CambiarSucursal(this,true,this)).setVisible(true);
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    @SuppressWarnings("empty-statement")
    public static void guardarCache(PreparedStatement prepare, String tabla, Boolean guardar) {//este metodo guarda un preparedstatement en cache
        String consultar = prepare.toString();


        if (VentanaPrincipal.local && guardar) {
            
            try {
                consultar = consultar.replace("last_insert_rowid", "LAST_INSERT_ID");
                System.out.println(consultar);
                ps = (PreparedStatement) cache_connection.cn.prepareStatement("insert into cache(consulta,tabla) values(?,?)");
                ps.setString(1, consultar.replace("CURRENT_TIMESTAMP",("'"+sdf.format(new java.util.Date()))+"'"));
                ps.setString(2, tabla);
                ps.execute();
                if (tabla.equals("personas")) {
                    ps = (PreparedStatement) cache_connection.cn.prepareStatement("insert into cache(consulta,tabla) values(?,?)");
                    ps.setString(1, "insert into cambios(consulta,tabla) values('"+consultar+"','"+tabla+"')");
                    ps.setString(2, "cambios");
                    ps.execute();
                }
                // System.out.println(consulta);
            } catch (SQLException ex) {
                logger.log(Level.SEVERE, null, ex);
            }
        }
        if ((!VentanaPrincipal.local)) {
            try {
                String consultaCache = consultar.replace("LAST_INSERT_ID", "last_insert_rowid");
                ps = cache_connection.cn.prepareStatement(consultaCache);
                ps.execute();
                if (tabla.equals("personas")) {
                    ps = (PreparedStatement) local_connection.cn.prepareStatement("insert into cambios(consulta,tabla) values(?,?)");
                    ps.setString(1, consultar);
                    ps.setString(2, tabla);
                    ps.execute();
                }
            } catch (SQLException ex) {
                logger.log(Level.SEVERE, null, ex);
            }
        }
    }

    private void cargarLog() {//este metodo inicializa el log de errores
        try {

            FileHandler fh;
            fh = new FileHandler("errores.txt", true);
            logger.addHandler(fh);
            SimpleFormatter formatter = new SimpleFormatter();
            fh.setFormatter(formatter);
        } catch (IOException | SecurityException ex) {
            logger.log(Level.SEVERE, null, ex);

        }
    }
    /**
     * @param args the command line arguments
     */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private static javax.swing.JMenu Actualizar;
    private static javax.swing.JMenu Cambio;
    private javax.swing.JMenuItem JMagregarNuevo;
    private static javax.swing.JMenu JMcliente;
    private static javax.swing.JMenu JMventas;
    private javax.swing.JMenuItem JMverTodos;
    public static javax.swing.JProgressBar actualizacion;
    public static javax.swing.JLabel baseDatos;
    private javax.swing.JMenuItem cerrarSesion;
    private static javax.swing.JMenu fileMenu;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem22;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JPanel jPanel2;
    public javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JLabel vendedor;
    // End of variables declaration//GEN-END:variables
    public cambiarConexion miconexion;
    public detalleDescuento detalle;
    public configurarImpresora nuevaImpresora;
    public cambiarFolios misFolios;
    ventas detalleVentas;
    Usuario cambiarUser;
}
